package com.bbird.od.finance.service.models.type;

import com.alibaba.fastjson.annotation.JSONType;
import lombok.Getter;

/**
 * @author ziyang Kuang
 * @date 2020/11/16
 * @describe
 */

@Getter
@JSONType(serializeEnumAsJavaBean = true)
public enum FundActionType {

    INCOME("收入"),
    OUTPUT("支出");

    private String label;
    private String name;

    FundActionType(String label) {
        this.name = name();
        this.label = label;

    }

    public static FundActionType getByLabel(String label) {
        for (FundActionType value : FundActionType.values()) {
            if (value.getLabel().equals(label)) {
                return value;
            }
        }
        return null;
    }
}
